<template>
  <div>
    运费管理
    <!-- let list =[ {
    "gmtCreate": 1656379357000,
    "gmtUpdate": 1656379357000,
    "id": 493,
    "spuId": 1237128,
    "title": "尺寸"
  },
  {
    "gmtCreate": 1656379357000,
    "gmtUpdate": 1656379357000,
    "id": 495,
    "spuId": 1237128,
    "title": "面料"
  },
  {
    "gmtCreate": 1656379357000,
    "gmtUpdate": 1656379357000,
    "id": 494,
    "spuId": 1237128,
    "title": "颜色"
  }
    ] let id = '' let num = [] let date = list.find((item)=>{if(item.id>id)return item}) return num.push(date)-->
  </div>
</template>
<script>
export default {
  data() {
    return {
      list: [{
          gmtCreate: 1656379357000,
          gmtUpdate: 1656379357000,
          id: 493,
          spuId: 1237128,
          title: "尺寸",
        },{
          gmtCreate: 1656379357000,
          gmtUpdate: 1656379357000,
          id: 495,
          spuId: 1237128,
          title: "面料",
        }, {
          gmtCreate: 1656379357000,
          gmtUpdate: 1656379357000,
          id: 494,
          spuId: 1237128,
          title: "颜色",
        },
      ],
    };
  },
  created() {
    this.aa();
  },
  methods: {
    aa() {
        let shu = []
      let str = "尺寸_小码,颜色_白色,面料_棉花";//让数组的排序与字符串真的排序对应
        // let aa = str.split(",").map(item=>item.split("_")[0]).map((ite)=>{
        //     shu.push(this.list.find(item=>item.title==ite))
        // })
      console.log(str.split(","), 11); //分割字符串   ['尺寸_小码', '颜色_白色', '面料_棉花'] 11
      let aa = str.split(",").map((item) => {
        //把数组里面的值映射出来
        console.log(item, 22); //尺寸_小码 22 颜色_白色 22 面料_棉花 22
        item.split("_")[0];
        console.log(item.split("_")[0], 33); //继续截取字符串
        return item.split("_")[0];
      });
       aa.map((item1) => {
       this.list.find((item) => {
          if (item.title == item1) {
           shu.push(item)
          }
        });
      });
        console.log(shu,8888);


    },
  },
};
</script>